﻿#region

using FluentNHibernate.Mapping;

#endregion

namespace MediaSage.Lib.Database
{
    public class ConfigMap : ClassMap<ConfigEntity>
    {
        #region Constructors

        public ConfigMap()
        {
            Table("Configuration");
            Id(x => x.ID).GeneratedBy.GuidComb().UnsavedValue("00000000-0000-0000-0000-000000000000");
            Map(x => x.MergeType);
            Map(x => x.ForceRescan);
            Map(x => x.GetAllImages);
            Map(x => x.GuessScoreThreshold);
            Map(x => x.ImageDir);
            Map(x => x.LogFile);
            Map(x => x.LogLevel);
            Map(x => x.MaxImageCount);
            Map(x => x.NumberOfReturnedMoviesFromGuess);
            Map(x => x.ScanFrequency);
            Map(x => x.ThreadTimeout);
            Map(x => x.MaxWorkerThreads);
            HasMany(x => x.FileSystems).Cascade.All().Table("FileSystemScan");
            HasMany(x => x.MediaTypes).Cascade.All().Table("MediaFileTypes");
            HasMany(x => x.Plugins).Cascade.All().Table("Providers");
            Map(x => x.UpdateAutomatically);
            Map(x => x.UpdateURL);
            Map(x => x.CreateImageThumbnails);
            Map(x => x.ConvertImageToType);
            Map(x => x.ConvertImages);
            Map(x => x.DBLogLevel);
            Map(x => x.MergeOnPersonName);
            Map(x => x.PluginDirectory);
            Map(x => x.RescanFrequency);
        }

        #endregion Constructors
    }
}